<?php
global $_GPC, $_W;
$GLOBALS['frames'] = $this->getMainMenu();
 $item=pdo_get('zh_yjm_system');
    if(checksubmit('submit')){
             $data['appkey']=trim($_GPC['appkey']);
             $data['tpl_id']=trim($_GPC['tpl_id']);
             $data['uniacid']=trim($_W['uniacid']);
             // $data['create_time'] =date('Y-m-d H:i:s',time());
            if(empty($item)){                
                $res=pdo_insert('zh_yjm_system',$data);
                if($res){
                    message('添加成功',$this->createWebUrl('code',array()),'success');
                }else{
                    message('添加失败','','error');
                }
            }else{
                $res = pdo_update('zh_yjm_system', $data, array('id' => $_GPC['id']));
                if($res){
                    message('编辑成功',$this->createWebUrl('code',array()),'success');
                }else{
                    message('编辑失败','','error');
                }
            }
        }
    include $this->template('web/code');